FROM golang:1.17-alpine3.16 AS builder

ENV GO111MODULE=on \
    GOPROXY=https://goproxy.cn,direct

COPY . /go/src/gin-scaffold

WORKDIR /go/src/gin-scaffold
RUN go install ./...

FROM alpine:3.16

COPY ./conf_online /conf_online
COPY --from=builder /go/bin/gin-scaffold /bin/gin-scaffold

ENV PROFILE_PATH="/conf_online/config.yaml"

EXPOSE 8080

ENTRYPOINT [ "/bin/gin-scaffold" ]